//
//  AppDelegate+ClientHelper.m
//  baodongPro
//
//  Created by feng on 16/8/18.
//  Copyright © 2016年 proper. All rights reserved.
//
#define FBDAPPDLEGATE  (AppDelegate*)[UIApplication sharedApplication].delegate
#import "AppDelegate+ClientHelper.h"

@implementation AppDelegate (ClientHelper)
/**
 *      @author 冯宝东
 *
 *      初始化消息管理的方法
 */
-(void)configeClientSetting
{
    
//[[NSNotificationCenter defaultCenter] addObserverForName:<#(nullable NSString *)#> object:<#(nullable id)#> queue:<#(nullable NSOperationQueue *)#> usingBlock:<#^(NSNotification * _Nonnull note)block#>]



}


/**
 *      @author 冯宝东
 *
 *      退出： 当前的用户
 */
+(void)appLoginOutForCurrentUser
{
    
    AppDelegate*deleteSelf=FBDAPPDLEGATE;
    [deleteSelf appLoginOutForCurrentUser];

}


/**
 *      @author 冯宝东
 *
 *      登录： 当前的用户
 */
+(void)appLoginInForCurrentUser
{
    AppDelegate*deleteSelf=FBDAPPDLEGATE;
    [deleteSelf appLoginInForCurrentUser];

}

/**
 *      @author 冯宝东
 *
 *      退出： 当前的用户
 */
-(void)appLoginOutForCurrentUser
{
     AppDelegate*appDeleagte= FBDAPPDLEGATE;
    [UIApplication sharedApplication].keyWindow.rootViewController=[appDeleagte fbd_loginVC];
    [USER_D removeObjectForKey:CurrentUserName];
    [USER_D synchronize];
    FBDTabBarViewController*tabBar=[self fbd_tabBarVC];
    UINavigationController* mineNVC=[tabBar getItemNavgationControllerIndex:2];
    [mineNVC popToRootViewControllerAnimated:YES];
    [[NSNotificationCenter defaultCenter]postNotificationName:APP_LOGINOUT_NOTIFACTION object:nil userInfo:nil];

}


/**
 *      @author 冯宝东
 *
 *      登录： 当前的用户
 */
-(void)appLoginInForCurrentUser
{

    

    [[NSNotificationCenter defaultCenter]postNotificationName:APP_LOGININ_NOTIFACTION object:nil userInfo:nil];
    NSLog(@"当前的APP已经登录了");
}


@end
